﻿using System;
using Avalonia.Controls;
using FluentAvalonia.UI.Controls;
using LearnTodo.Models;

namespace LearnTodo.Views;

public class NavigationFactory : INavigationPageFactory
{
    public Control GetPage(Type srcType)
    {
        return new Border();
    }

    public Control GetPageFromObject(object target)
    {
        if (target.ToString() == "Home")
        {
            return new HomePage();
        }

        if (target is TodoModel model)
        {
            return new TodoPage(model);
        }
        throw new NotImplementedException();
    }
}